Repository navigation
feat(c): add bounded commit-message range export - #1330
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: Closes #1327.
Related to #910 and #1257.
An embedding engine needs to export bounded ranges before passing commit bodies to a size-limited
RPC. The existing API serializes every message before a caller can check the
resulting size.
Prepared with AI assistance.
Brief change log
CommitMessage::serialize_with_limit(max_bytes), checking before eachoutput append while preserving the existing serializer and Java v14 bytes.
paimon_commit_messages_count(messages, count_output)andpaimon_commit_messages_serialize_range(messages, offset, count, max_bytes).overflow and bounds; return no partial output on failure and preserve the
source handle for a smaller-range retry.
Tests
Validated with the existing Rust 1.97.0 toolchain on macOS arm64:
cargo +1.97.0 test --locked -p paimon-c --lib: 95 passed, including the existingseparate worker/coordinator process test.
limits, cumulative limits, nonzero offsets, empty/invalid/overflowing ranges,
null handles and output pointers, retry, output lifetime and Format Table
rejection.
cargo +1.97.0 test --locked -p paimon --lib table::commit_message::tests: 3 passed.cargo +1.97.0 fmt --all -- --checkandgit diff --check: passed.cargo +1.97.0 clippy --locked -p paimon-c --all-targets -- -D warnings: passed.Not run locally: CI-pinned Rust 1.98.0 checks, the full workspace/Vortex
suite, or the Linux/MSRV matrix. The results above cover the listed commands.
API and Format
Additive Rust and C APIs. Existing full export and Java v14 body bytes remain
unchanged. No Java list wrapper, storage format or engine-specific framing is
added. The limit bounds the sum of body lengths, not peak allocations or RSS:
temporary metadata encoding, vector capacity and ownership conversion remain.
Documentation
Add a range-export/retry example and explain byte limits and ownership in the
C integration guide.